Graphql docs and tests#2589
Open
miratepuffin wants to merge 16 commits intodb_v4from
Open
Conversation
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: 383b851 | Previous: 9823ef7 | Ratio |
|---|---|---|---|
lotr_graph/num_edges |
5 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
lotr_graph/num_nodes |
127 ns/iter (± 31) |
1 ns/iter (± 0) |
127 |
lotr_graph/graph_latest |
3 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
lotr_graph_window_100/num_edges |
29 ns/iter (± 0) |
8 ns/iter (± 0) |
3.63 |
lotr_graph_window_100/num_nodes |
143 ns/iter (± 32) |
5 ns/iter (± 0) |
28.60 |
lotr_graph_window_100/has_node_existing |
46 ns/iter (± 0) |
22 ns/iter (± 0) |
2.09 |
lotr_graph_window_10/has_node_existing |
148 ns/iter (± 8) |
62 ns/iter (± 11) |
2.39 |
lotr_graph_window_10/iterate nodes |
36476 ns/iter (± 96) |
11339 ns/iter (± 40) |
3.22 |
lotr_graph_subgraph_10pc/has_edge_existing |
274 ns/iter (± 10) |
93 ns/iter (± 1) |
2.95 |
lotr_graph_subgraph_10pc/num_nodes |
124 ns/iter (± 27) |
4 ns/iter (± 0) |
31 |
lotr_graph_subgraph_10pc/has_node_existing |
121 ns/iter (± 0) |
34 ns/iter (± 0) |
3.56 |
lotr_graph_subgraph_10pc/iterate nodes |
2710 ns/iter (± 90) |
839 ns/iter (± 5) |
3.23 |
lotr_graph_subgraph_10pc_windowed/has_node_existing |
145 ns/iter (± 8) |
62 ns/iter (± 14) |
2.34 |
lotr_graph_subgraph_10pc_windowed/iterate nodes |
4822 ns/iter (± 95) |
1365 ns/iter (± 3) |
3.53 |
lotr_graph_window_50_layered/num_edges_temporal |
155845 ns/iter (± 3451) |
70121 ns/iter (± 7586) |
2.22 |
lotr_graph_window_50_layered/num_nodes |
63640 ns/iter (± 2203) |
21435 ns/iter (± 536) |
2.97 |
lotr_graph_window_50_layered/has_node_existing |
924 ns/iter (± 78) |
129 ns/iter (± 12) |
7.16 |
lotr_graph_window_50_layered/max_id |
70339 ns/iter (± 1360) |
25556 ns/iter (± 252) |
2.75 |
lotr_graph_window_50_layered/iterate nodes |
140103 ns/iter (± 554) |
19308 ns/iter (± 47) |
7.26 |
lotr_graph_window_50_layered/iterate edges |
197733 ns/iter (± 491) |
83616 ns/iter (± 1318) |
2.36 |
lotr_graph_window_50_layered/graph_latest |
105715 ns/iter (± 1068) |
36649 ns/iter (± 916) |
2.88 |
lotr_graph_persistent_window_50_layered/num_edges_temporal |
726889 ns/iter (± 3509) |
192686 ns/iter (± 1569) |
3.77 |
lotr_graph_persistent_window_50_layered/num_nodes |
83441 ns/iter (± 941) |
31517 ns/iter (± 779) |
2.65 |
lotr_graph_persistent_window_50_layered/has_node_existing |
1105 ns/iter (± 176) |
174 ns/iter (± 83) |
6.35 |
lotr_graph_persistent_window_50_layered/max_id |
92765 ns/iter (± 1206) |
38024 ns/iter (± 490) |
2.44 |
lotr_graph_persistent_window_50_layered/iterate nodes |
183859 ns/iter (± 1172) |
35886 ns/iter (± 191) |
5.12 |
lotr_graph_persistent_window_50_layered/iterate edges |
195394 ns/iter (± 483) |
84161 ns/iter (± 596) |
2.32 |
lotr_graph_persistent_window_50_layered/iterate_exploded_edges |
3443548 ns/iter (± 12361) |
1659940 ns/iter (± 19402) |
2.07 |
lotr_graph_persistent_window_50_layered/graph_latest |
160983 ns/iter (± 1911) |
57549 ns/iter (± 4809) |
2.80 |
lotr_graph_persistent_window_50_layered_materialise/materialize |
13062544 ns/iter (± 81624) |
5298035 ns/iter (± 147912) |
2.47 |
lotr_graph/proto_encode |
5824000 ns/iter (± 104993) |
1157897 ns/iter (± 73709) |
5.03 |
This comment was automatically generated by workflow using github-action-benchmark.
# Conflicts: # python/tests/test_base_install/test_graphql/test_gql_temporal_aggregates.py # raphtory-graphql/schema.graphql # raphtory-graphql/src/model/graph/property.rs
ljeub-pometry
approved these changes
Apr 27, 2026
Collaborator
ljeub-pometry
left a comment
There was a problem hiding this comment.
some minor test things to fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
graphql-docs-and-tests— Top-level SummaryBranch focused on hardening Raphtory's GraphQL surface: documenting it, expanding what its inputs accept, and verifying it from Python. Also picks up housekeeping on the Python bindings (PyO3 stubs, PyProp constructors).
Fixes #1937 #2101 #2238 #2302 #2301 #2300
Need to get smmoosavi/dynamic-graphql#42 merged
1. GraphQL schema: documentation + tests
Requires READ on the graph.,Requires WRITE on the parent namespace., etc.).dynamic-graphqlbranch that exposes per-argumentdescattributes (the released crate has no such hook).2. New / widened input scalars
Made a new
NodeIdforStringor non-negativeIntsimilar to TimeInput. The two scalars are wired through every relevant resolver: lookups (node,edge,hasNode,hasEdge), view transforms (subgraph,excludeNodes,sharedNeighbours), all mutations (addNode,addEdge,deleteEdge, batch variants,MutableGraph.{node,edge}),createSubgraph, andVectorSelection.{addNodes,addEdges}.Node.idandEdge.idnow returnNodeId(so an integer-indexed graph returns integers, not stringified ones).Filters already accepted both forms via the existing
Valuescalar — no schema change there, just verified.3. Graph-semantics override
graph(path: ..., graphType: EVENT | PERSISTENT)(and the same arg onMutableGraph.graph) lets a caller re-interpret a stored graph at query time:graphType: PERSISTENTcarries values forward in windows after the addition.graphType: EVENTonly sees updates exactly at the queried time.4. Temporal-property API changes
TemporalProperty.valuesnow returns typedPropValues instead of stringified values.TemporalProperty:sum,mean,median,min,max,count,average. Returningnullfor non-numeric value types.uniqueandorderedDedupereturn aTemporalPropertyso the aggregates compose.5. Python tests added
test_gql_node_id.pyNodeId(Int + String) on every read/write surfacetest_gql_mutation_time_input.pyTimeInputshapes (Int / RFC3339 / object) on every mutationtest_gql_graph_type.pygraphTypeoverride × stored type × window semanticstest_graphql_vectors.pyVectorisedGraphWindowwithTimeInputtest_props.pyPropconstructors (datetime, naive_datetime, decimal) — strings, PythonDecimal, ints, floats; graph round-trip; list unificationtest_load_from_pandas.pyPropType.decimal(scale),PropType.datetime(),PropType.naive_datetime()— string columns, ArrowDecimal128, both nodes and edges6. Python bindings (
raphtory-api,raphtory)New
Prop/PropTypeconstructorsProp.aware_datetime(dt)— tz-aware datetime (UTC-stored). Naive input rejected.Prop.naive_datetime(dt)— tz-naive datetime.Prop.decimal(value)— acceptsdecimal.Decimal,str,int, orfloat.PropType.decimal(scale)— schema-side companion (PropType.datetime()/PropType.naive_datetime()already existed). Letsload_nodes/load_edgesacceptschema={"col": PropType.decimal(2)}to cast string or ArrowDecimal128columns.Stub generation (
gen-stubs.py)PyPropValueListList,PyTemporalPropsList,PyTemporalPropsListList,PyPropHistValueList,PyPropHistValueListList,PyTemporalPropList,PyTemporalPropListList,PyPropHistItemsList,PyPropHistItemsListList,PropIterable) plusEmbeddingServer,RunningEmbeddingServer,OutputNodeStateso they resolve in generated stubs.raphtory.iterablesandraphtory.gqlintosys.modulesso submodule imports resolve.PyOutputNodeState→OutputNodeState,TypedNodeState→OutputNodeState,Str→str,NumpyArray→NDArray, etc.).gen-stubs.pyreports zero warnings;mypy -m raphtorypasses. (other than GQL which we can fix later)7. dynamic-graphql fork
Submitted upstream PR adding
descattribute support onResolvedObjectFieldsArg/InterfaceMethodArg/ExpandObjectFieldsArg. Branchadd-arg-descriptionsofmiratepuffin/dynamic-graphqlis referenced from this repo'sCargo.tomluntil upstream merges.